@@ -15,7 +15,8 @@ my %module_build_args = (
'Path::Class' => '0',
'Scalar::Util' => '0',
'Test::Exception' => '0',
- 'Test::More' => '0.94'
+ 'Test::More' => '0.94',
+ 'version' => '0'
},
'configure_requires' => {
'Module::Build' => '0.3601'
@@ -25,7 +26,7 @@ my %module_build_args = (
'Jerome Quelin'
],
'dist_name' => 'Dist-Zilla-Plugin-Git',
- 'dist_version' => '1.101680',
+ 'dist_version' => '1.102090',
'license' => 'perl',
'module_name' => 'Dist::Zilla::Plugin::Git',
'recommends' => {},
@@ -1,5 +1,28 @@
Revision history for Dist::Zilla::Plugin::Git
+1.102090 2010-07-28 14:12:20 Europe/Paris
+ - initialize a working git config in all tests
+
+1.102040 2010-07-23 10:45:23 Europe/Paris
+ - fix rt#59587 - cache buildroot to commit on master, not release
+ branch (yanick champoux)
+
+1.102020 2010-07-21 09:00:46 Europe/Paris
+ - fix rt#59586 - there should be no release branch by default for git::commitbuild
+ warning: this changes behaviour of git::commitbuild
+
+1.102010 2010-07-20 11:00:36 Europe/Paris
+ - fix rt#59505 - support for unstable git versions in push test skips
+
+1.101801 2010-06-29 19:00:13 Europe/Paris
+ - fix rt#56485 - skip push tests for old git versions
+
+1.101800 2010-06-29 18:36:17 Europe/Paris
+ - git::commitbuild - new release_branch option to commit result after a
+ release (yanick champoux)
+ - git::tag - tag can be applied to a different branch (yanick champoux)
+ - fix rt#58876 - pod description out of date
+
1.101680 2010-06-17 17:17:07 Europe/Paris
- fix rt# 58431 - remove git.pm prereq, use git::wrapper (yanick champoux)
@@ -2,7 +2,6 @@ Build.PL
Changes
LICENSE
MANIFEST
-META.json
META.yml
README
dist.ini
@@ -1,353 +0,0 @@
-{
- "abstract" : "update your git repository after release",
- "author" : [
- "Jerome Quelin"
- ],
- "dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.101612, CPAN::Meta::Converter version 2.101610",
- "license" : [
- "perl_5"
- ],
- "meta-spec" : {
- "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
- },
- "name" : "Dist-Zilla-Plugin-Git",
- "prereqs" : {
- "build" : {
- "requires" : {
- "Module::Build" : "0.3601"
- }
- },
- "configure" : {
- "requires" : {
- "Module::Build" : "0.3601"
- }
- },
- "runtime" : {
- "requires" : {
- "Class::MOP" : 0,
- "Cwd" : 0,
- "DateTime" : 0,
- "Dist::Zilla" : "2.100880",
- "Dist::Zilla::Role::AfterBuild" : 0,
- "Dist::Zilla::Role::AfterMint" : 0,
- "Dist::Zilla::Role::AfterRelease" : 0,
- "Dist::Zilla::Role::BeforeRelease" : 0,
- "Dist::Zilla::Role::PluginBundle" : 0,
- "File::Spec::Functions" : 0,
- "File::Temp" : 0,
- "File::chdir" : 0,
- "Git::Wrapper" : 0,
- "IPC::Open3" : 0,
- "Moose" : 0,
- "Moose::Autobox" : 0,
- "Moose::Role" : 0,
- "MooseX::Has::Sugar" : 0,
- "MooseX::Types::Moose" : 0,
- "String::Formatter" : 0,
- "perl" : "5.010"
- }
- },
- "test" : {
- "requires" : {
- "Carp" : 0,
- "Dist::Zilla::Tester" : 0,
- "English" : 0,
- "File::Find" : 0,
- "Path::Class" : 0,
- "Scalar::Util" : 0,
- "Test::Exception" : 0,
- "Test::More" : "0.94"
- }
- }
- },
- "provides" : {
- "Dist::Zilla::Plugin::Git" : {
- "file" : "lib/Dist/Zilla/Plugin/Git.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Plugin::Git::Check" : {
- "file" : "lib/Dist/Zilla/Plugin/Git/Check.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Plugin::Git::Commit" : {
- "file" : "lib/Dist/Zilla/Plugin/Git/Commit.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Plugin::Git::CommitBuild" : {
- "file" : "lib/Dist/Zilla/Plugin/Git/CommitBuild.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Plugin::Git::Init" : {
- "file" : "lib/Dist/Zilla/Plugin/Git/Init.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Plugin::Git::Push" : {
- "file" : "lib/Dist/Zilla/Plugin/Git/Push.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Plugin::Git::Tag" : {
- "file" : "lib/Dist/Zilla/Plugin/Git/Tag.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::PluginBundle::Git" : {
- "file" : "lib/Dist/Zilla/PluginBundle/Git.pm",
- "version" : "1.101680"
- },
- "Dist::Zilla::Role::Git::DirtyFiles" : {
- "file" : "lib/Dist/Zilla/Role/Git/DirtyFiles.pm",
- "version" : "1.101680"
- }
- },
- "release_status" : "stable",
- "resources" : {
- "bugtracker" : {
- "mailto" : "bug-dist-zilla-plugin-git at rt.cpan.org",
- "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Git"
- },
- "homepage" : "http://search.cpan.org/dist/Dist-Zilla-Plugin-Git/",
- "repository" : {
- "url" : "http://github.com/jquelin/dist-zilla-plugin-git"
- },
- "x_mailing_list" : "http://www.listbox.com/subscribe/?list_id=139292"
- },
- "version" : "1.101680",
- "x_Dist_Zilla" : {
- "plugins" : [
- {
- "class" : "Dist::Zilla::Plugin::MetaResources",
- "name" : "MetaResources",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::AutoVersion",
- "name" : "@JQUELIN/AutoVersion",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::GatherDir",
- "name" : "@JQUELIN/GatherDir",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::CompileTests",
- "name" : "@JQUELIN/CompileTests",
- "version" : "1.101600"
- },
- {
- "class" : "Dist::Zilla::Plugin::CriticTests",
- "name" : "@JQUELIN/CriticTests",
- "version" : "1.100140"
- },
- {
- "class" : "Dist::Zilla::Plugin::HasVersionTests",
- "name" : "@JQUELIN/HasVersionTests",
- "version" : "1.101420"
- },
- {
- "class" : "Dist::Zilla::Plugin::KwaliteeTests",
- "name" : "@JQUELIN/KwaliteeTests",
- "version" : "1.101420"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaTests",
- "name" : "@JQUELIN/MetaTests",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::MinimumVersionTests",
- "name" : "@JQUELIN/MinimumVersionTests",
- "version" : "1.101421"
- },
- {
- "class" : "Dist::Zilla::Plugin::PodCoverageTests",
- "name" : "@JQUELIN/PodCoverageTests",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::PodSyntaxTests",
- "name" : "@JQUELIN/PodSyntaxTests",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::PortabilityTests",
- "name" : "@JQUELIN/PortabilityTests",
- "version" : "1.101420"
- },
- {
- "class" : "Dist::Zilla::Plugin::ReportVersions",
- "name" : "@JQUELIN/ReportVersions",
- "version" : "1.101600"
- },
- {
- "class" : "Dist::Zilla::Plugin::UnusedVarsTests",
- "name" : "@JQUELIN/UnusedVarsTests",
- "version" : "1.100860"
- },
- {
- "class" : "Dist::Zilla::Plugin::PruneCruft",
- "name" : "@JQUELIN/PruneCruft",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::ManifestSkip",
- "name" : "@JQUELIN/ManifestSkip",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::AutoPrereq",
- "name" : "@JQUELIN/AutoPrereq",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::ExtraTests",
- "name" : "@JQUELIN/ExtraTests",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::NextRelease",
- "name" : "@JQUELIN/NextRelease",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::PkgVersion",
- "name" : "@JQUELIN/PkgVersion",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::PodWeaver",
- "name" : "@JQUELIN/PodWeaver",
- "version" : "3.101530"
- },
- {
- "class" : "Dist::Zilla::Plugin::Prepender",
- "name" : "@JQUELIN/Prepender",
- "version" : "1.101590"
- },
- {
- "class" : "Dist::Zilla::Plugin::ExecDir",
- "name" : "@JQUELIN/ExecDir",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::ShareDir",
- "name" : "@JQUELIN/ShareDir",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::Bugtracker",
- "name" : "@JQUELIN/Bugtracker",
- "version" : "1.101490"
- },
- {
- "class" : "Dist::Zilla::Plugin::Homepage",
- "name" : "@JQUELIN/Homepage",
- "version" : "1.101420"
- },
- {
- "class" : "Dist::Zilla::Plugin::Repository",
- "name" : "@JQUELIN/Repository",
- "version" : "0.13"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaProvides::Package",
- "name" : "@JQUELIN/MetaProvides::Package",
- "version" : "1.10027802"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaConfig",
- "name" : "@JQUELIN/MetaConfig",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::License",
- "name" : "@JQUELIN/License",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaYAML",
- "name" : "@JQUELIN/MetaYAML",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaJSON",
- "name" : "@JQUELIN/MetaJSON",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::ModuleBuild",
- "name" : "@JQUELIN/ModuleBuild",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::Readme",
- "name" : "@JQUELIN/Readme",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::Manifest",
- "name" : "@JQUELIN/Manifest",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::CheckChangeLog",
- "name" : "@JQUELIN/CheckChangeLog",
- "version" : "0.01"
- },
- {
- "class" : "Dist::Zilla::Plugin::UploadToCPAN",
- "name" : "@JQUELIN/UploadToCPAN",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Check",
- "name" : "@JQUELIN/Git/Check",
- "version" : "1.101330"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Commit",
- "name" : "@JQUELIN/Git/Commit",
- "version" : "1.101330"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Tag",
- "name" : "@JQUELIN/Git/Tag",
- "version" : "1.101330"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Push",
- "name" : "@JQUELIN/Git/Push",
- "version" : "1.101330"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":InstallModules",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":TestFiles",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":ExecFiles",
- "version" : "4.101612"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":ShareFiles",
- "version" : "4.101612"
- }
- ],
- "zilla" : {
- "class" : "Dist::Zilla",
- "config" : {
- "is_trial" : 0
- },
- "version" : "4.101612"
- }
- }
-}
-
@@ -12,10 +12,11 @@ build_requires:
Scalar::Util: 0
Test::Exception: 0
Test::More: 0.94
+ version: 0
configure_requires:
Module::Build: 0.3601
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.101612, CPAN::Meta::Converter version 2.101610'
+generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,31 +25,31 @@ name: Dist-Zilla-Plugin-Git
provides:
Dist::Zilla::Plugin::Git:
file: lib/Dist/Zilla/Plugin/Git.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Plugin::Git::Check:
file: lib/Dist/Zilla/Plugin/Git/Check.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Plugin::Git::Commit:
file: lib/Dist/Zilla/Plugin/Git/Commit.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Plugin::Git::CommitBuild:
file: lib/Dist/Zilla/Plugin/Git/CommitBuild.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Plugin::Git::Init:
file: lib/Dist/Zilla/Plugin/Git/Init.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Plugin::Git::Push:
file: lib/Dist/Zilla/Plugin/Git/Push.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Plugin::Git::Tag:
file: lib/Dist/Zilla/Plugin/Git/Tag.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::PluginBundle::Git:
file: lib/Dist/Zilla/PluginBundle/Git.pm
- version: 1.101680
+ version: 1.102090
Dist::Zilla::Role::Git::DirtyFiles:
file: lib/Dist/Zilla/Role/Git/DirtyFiles.pm
- version: 1.101680
+ version: 1.102090
requires:
Class::MOP: 0
Cwd: 0
@@ -76,25 +77,25 @@ resources:
bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Git
homepage: http://search.cpan.org/dist/Dist-Zilla-Plugin-Git/
repository: http://github.com/jquelin/dist-zilla-plugin-git
-version: 1.101680
+version: 1.102090
x_Dist_Zilla:
plugins:
-
class: Dist::Zilla::Plugin::MetaResources
name: MetaResources
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::AutoVersion
name: '@JQUELIN/AutoVersion'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::GatherDir
name: '@JQUELIN/GatherDir'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::CompileTests
name: '@JQUELIN/CompileTests'
- version: 1.101600
+ version: 1.101800
-
class: Dist::Zilla::Plugin::CriticTests
name: '@JQUELIN/CriticTests'
@@ -110,7 +111,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::MetaTests
name: '@JQUELIN/MetaTests'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::MinimumVersionTests
name: '@JQUELIN/MinimumVersionTests'
@@ -118,11 +119,11 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::PodCoverageTests
name: '@JQUELIN/PodCoverageTests'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@JQUELIN/PodSyntaxTests'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::PortabilityTests
name: '@JQUELIN/PortabilityTests'
@@ -130,7 +131,7 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::ReportVersions
name: '@JQUELIN/ReportVersions'
- version: 1.101600
+ version: 1.101700
-
class: Dist::Zilla::Plugin::UnusedVarsTests
name: '@JQUELIN/UnusedVarsTests'
@@ -138,31 +139,31 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@JQUELIN/PruneCruft'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::ManifestSkip
name: '@JQUELIN/ManifestSkip'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::AutoPrereq
name: '@JQUELIN/AutoPrereq'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::ExtraTests
name: '@JQUELIN/ExtraTests'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::NextRelease
name: '@JQUELIN/NextRelease'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::PkgVersion
name: '@JQUELIN/PkgVersion'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::PodWeaver
name: '@JQUELIN/PodWeaver'
- version: 3.101530
+ version: 3.101640
-
class: Dist::Zilla::Plugin::Prepender
name: '@JQUELIN/Prepender'
@@ -170,11 +171,11 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::ExecDir
name: '@JQUELIN/ExecDir'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::ShareDir
name: '@JQUELIN/ShareDir'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::Bugtracker
name: '@JQUELIN/Bugtracker'
@@ -190,35 +191,31 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::MetaProvides::Package
name: '@JQUELIN/MetaProvides::Package'
- version: 1.10027802
+ version: 1.11034304
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@JQUELIN/MetaConfig'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::License
name: '@JQUELIN/License'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@JQUELIN/MetaYAML'
- version: 4.101612
- -
- class: Dist::Zilla::Plugin::MetaJSON
- name: '@JQUELIN/MetaJSON'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::ModuleBuild
name: '@JQUELIN/ModuleBuild'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::Readme
name: '@JQUELIN/Readme'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::Manifest
name: '@JQUELIN/Manifest'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::CheckChangeLog
name: '@JQUELIN/CheckChangeLog'
@@ -226,41 +223,41 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@JQUELIN/UploadToCPAN'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::Git::Check
name: '@JQUELIN/Git/Check'
- version: 1.101330
+ version: 1.100970
-
class: Dist::Zilla::Plugin::Git::Commit
name: '@JQUELIN/Git/Commit'
- version: 1.101330
+ version: 1.100970
-
class: Dist::Zilla::Plugin::Git::Tag
name: '@JQUELIN/Git/Tag'
- version: 1.101330
+ version: 1.100970
-
class: Dist::Zilla::Plugin::Git::Push
name: '@JQUELIN/Git/Push'
- version: 1.101330
+ version: 1.100970
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
- version: 4.101612
+ version: 4.101900
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
- version: 4.101612
+ version: 4.101900
zilla:
- class: Dist::Zilla
+ class: Dist::Zilla::Dist::Builder
config:
is_trial: 0
- version: 4.101612
+ version: 4.101900
@@ -1,7 +1,7 @@
This archive contains the distribution Dist-Zilla-Plugin-Git,
-version 1.101680:
+version 1.102090:
update your git repository after release
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Check;
BEGIN {
- $Dist::Zilla::Plugin::Git::Check::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::Check::VERSION = '1.102090';
}
# ABSTRACT: check your git repository before releasing
@@ -78,7 +78,7 @@ Dist::Zilla::Plugin::Git::Check - check your git repository before releasing
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 SYNOPSIS
@@ -125,7 +125,7 @@ can use C<allow_dirty => to prohibit all local modifications.
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Commit;
BEGIN {
- $Dist::Zilla::Plugin::Git::Commit::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::Commit::VERSION = '1.102090';
}
# ABSTRACT: commit dirty files
@@ -107,7 +107,7 @@ Dist::Zilla::Plugin::Git::Commit - commit dirty files
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 SYNOPSIS
@@ -176,7 +176,7 @@ reads the Changes file to get the list of changes in the just-released version.
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::CommitBuild;
BEGIN {
- $Dist::Zilla::Plugin::Git::CommitBuild::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::CommitBuild::VERSION = '1.102090';
}
# ABSTRACT: checkin build results on separate branch
@@ -42,22 +42,42 @@ use String::Formatter (
}
);
-with 'Dist::Zilla::Role::AfterBuild';
+with 'Dist::Zilla::Role::AfterBuild', 'Dist::Zilla::Role::AfterRelease';
# -- attributes
has branch => ( ro, isa => Str, default => 'build/%b', required => 1 );
+has release_branch => ( ro, isa => Str, required => 0 );
has message => ( ro, isa => Str, default => 'Build results of %h (on %b)', required => 1 );
+has build_root => ( rw );
# -- role implementation
sub after_build {
my ( $self, $args) = @_;
+ # because the build_root mysteriously change at
+ # the 'after_release' stage
+ $self->build_root( $args->{build_root} );
+
+ $self->_commit_build( $args, $self->branch );
+}
+
+sub after_release {
+ my ( $self, $args) = @_;
+
+ $self->_commit_build( $args, $self->release_branch );
+}
+
+sub _commit_build {
+ my ( $self, undef, $branch ) = @_;
+
+ return unless $branch;
+
my $tmp_dir = File::Temp->newdir( CLEANUP => 1) ;
my $src = Git::Wrapper->new('.');
- my $dir = rel2abs( $args->{build_root} );
+ my $dir = rel2abs( $self->build_root );
my $tree = do {
# don't overwrite the user's index
@@ -73,7 +93,7 @@ sub after_build {
($write_tree_repo->write_tree)[0];
};
- my $target_branch = _format_branch( $self->branch, $src );
+ my $target_branch = _format_branch( $branch, $src );
# no change, abort
return
@@ -116,7 +136,7 @@ Dist::Zilla::Plugin::Git::CommitBuild - checkin build results on separate branch
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 SYNOPSIS
@@ -145,6 +165,12 @@ build contents
A single formatting code (C<%b>) is defined for this attribute and will be
substituted with the name of the current branch in your git repository.
+=item * release_branch - L<String::Formatter> string for where to commit the
+build contents
+
+Same as C<branch>, but commit the build content only after a release. No
+default, meaning no release branch.
+
=item * message - L<String::Formatter> string for what commit message
to use when committing the results of the build.
@@ -163,10 +189,11 @@ This option supports three formatting codes:
=back
=for Pod::Coverage after_build
+ after_release
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Init;
BEGIN {
- $Dist::Zilla::Plugin::Git::Init::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::Init::VERSION = '1.102090';
}
# ABSTRACT: initialize git repository on dzil new
@@ -48,7 +48,7 @@ Dist::Zilla::Plugin::Git::Init - initialize git repository on dzil new
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 DESCRIPTION
@@ -59,7 +59,7 @@ created with C<dzil new>.
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Push;
BEGIN {
- $Dist::Zilla::Plugin::Git::Push::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::Push::VERSION = '1.102090';
}
# ABSTRACT: push current branch
@@ -59,7 +59,7 @@ Dist::Zilla::Plugin::Git::Push - push current branch
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 SYNOPSIS
@@ -90,7 +90,7 @@ This may be specified multiple times to push to multiple repositories.
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git::Tag;
BEGIN {
- $Dist::Zilla::Plugin::Git::Tag::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::Tag::VERSION = '1.102090';
}
# ABSTRACT: tag the new version
@@ -39,7 +39,7 @@ with 'Dist::Zilla::Role::AfterRelease';
has tag_format => ( ro, isa=>Str, default => 'v%v' );
has tag_message => ( ro, isa=>Str, default => 'v%v' );
-
+has branch => ( ro, isa=>Str, predicate=>'has_branch' );
# -- role implementation
@@ -61,10 +61,11 @@ sub after_release {
my @opts = $self->tag_message
? ( '-m' => _format_tag($self->tag_message, $self->zilla) )
: ();
+ my @branch = $self->has_branch ? ( $self->branch ) : ();
# create a tag with the new version
my $tag = _format_tag($self->tag_format, $self->zilla);
- $git->tag( @opts, $tag );
+ $git->tag( @opts, $tag, @branch );
$self->log("Tagged $tag");
}
@@ -79,7 +80,7 @@ Dist::Zilla::Plugin::Git::Tag - tag the new version
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 SYNOPSIS
@@ -101,37 +102,46 @@ doesn't already exist. (You would have to manually delete the
existing tag before you could release the same version again, but that
is almost never a good idea.)
+=head2 Plugin options
+
The plugin accepts the following options:
=over 4
-=item * tag_format - format of the tag to apply. Defaults to C<v%v>.
+=item * tag_format - format of the tag to apply. Defaults to C<v%v>, see
+C<Formatting options> below.
-=item * tag_message - format of the commit message. Defaults to C<v%v>.
-Use C<tag_message = > to create a lightweight tag.
+=item * tag_message - format of the commit message. Defaults to C<v%v>,
+see C<Formatting options> below. Use C<tag_message = > to create a
+lightweight tag.
+
+=item * branch - which branch to tag. Defaults to current branch.
=back
-You can use the following codes in both options:
+=head2 Formatting options
+
+Some plugin options allow you to customize the tag content. You can use
+the following codes at your convenience:
=over 4
=item C<%{dd-MMM-yyyy}d>
The current date. You can use any CLDR format supported by
-L<DateTime>. A bare C<%d> means C<%{dd-MMM-yyyy}d>.
+L<DateTime>. A bare C<%d> means C<%{dd-MMM-yyyy}d>.
=item C<%n>
-a newline
+A newline
=item C<%N>
-the distribution name
+The distribution name
=item C<%v>
-the distribution version
+The distribution version
=back
@@ -140,7 +150,7 @@ the distribution version
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Plugin::Git;
BEGIN {
- $Dist::Zilla::Plugin::Git::VERSION = '1.101680';
+ $Dist::Zilla::Plugin::Git::VERSION = '1.102090';
}
# ABSTRACT: update your git repository after release
@@ -28,7 +28,7 @@ Dist::Zilla::Plugin::Git - update your git repository after release
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 DESCRIPTION
@@ -42,14 +42,18 @@ following plugins are provided in this distribution:
=item * L<Dist::Zilla::Plugin::Git::Commit>
-=item * L<Dist::Zilla::Plugin::Git::Tag>
+=item * L<Dist::Zilla::Plugin::Git::CommitBuild>
+
+=item * L<Dist::Zilla::Plugin::Git::Init>
=item * L<Dist::Zilla::Plugin::Git::Push>
+=item * L<Dist::Zilla::Plugin::Git::Tag>
+
=back
-If you want to use all of them at once, you will be interested by
-L<Dist::Zilla::PluginBundle::Git>.
+A L<Dist::Zilla::PluginBundle::Git> bundle is also provided for your
+convenience, check its documentation to see which plugins it will load.
=head1 SEE ALSO
@@ -85,7 +89,7 @@ L<http://cpanratings.perl.org/d/Dist-Zilla-Plugin-Git>
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::PluginBundle::Git;
BEGIN {
- $Dist::Zilla::PluginBundle::Git::VERSION = '1.101680';
+ $Dist::Zilla::PluginBundle::Git::VERSION = '1.102090';
}
# ABSTRACT: all git plugins in one go
@@ -66,7 +66,7 @@ Dist::Zilla::PluginBundle::Git - all git plugins in one go
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 SYNOPSIS
@@ -97,7 +97,7 @@ The options are passed through to the plugins.
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -12,7 +12,7 @@ use warnings;
package Dist::Zilla::Role::Git::DirtyFiles;
BEGIN {
- $Dist::Zilla::Role::Git::DirtyFiles::VERSION = '1.101680';
+ $Dist::Zilla::Role::Git::DirtyFiles::VERSION = '1.102090';
}
# ABSTRACT: provide the allow_dirty & changelog attributes
@@ -70,7 +70,7 @@ Dist::Zilla::Role::Git::DirtyFiles - provide the allow_dirty & changelog attribu
=head1 VERSION
-version 1.101680
+version 1.102090
=head1 DESCRIPTION
@@ -106,7 +106,7 @@ In scalar context, returns the number of dirty files.
=head1 AUTHOR
- Jerome Quelin
+Jerome Quelin
=head1 COPYRIGHT AND LICENSE
@@ -31,13 +31,14 @@ find(
my @scripts = glob "bin/*";
-plan tests => scalar(@modules) + scalar(@scripts);
+my $plan = scalar(@modules) + scalar(@scripts);
+$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
{
# fake home for cpan-testers
# no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 );
- like( qx{ $^X -Ilib -e "use $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
+ like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
for sort @modules;
SKIP: {
@@ -22,25 +22,25 @@ use Carp 'croak';
# UTF Support?
sub HAVE_UTF8 () { $] >= 5.007003 }
BEGIN {
- if ( HAVE_UTF8 ) {
- # The string eval helps hide this from Test::MinimumVersion
- eval "require utf8;";
- die "Failed to load UTF-8 support" if $@;
- }
-
- # Class structure
- require 5.004;
- $YAML::Tiny::VERSION = '1.40';
-
- # Error storage
- $YAML::Tiny::errstr = '';
+ if ( HAVE_UTF8 ) {
+ # The string eval helps hide this from Test::MinimumVersion
+ eval "require utf8;";
+ die "Failed to load UTF-8 support" if $@;
+ }
+
+ # Class structure
+ require 5.004;
+ $YAML::Tiny::VERSION = '1.40';
+
+ # Error storage
+ $YAML::Tiny::errstr = '';
}
# Printable characters for escapes
my %UNESCAPES = (
- z => "\x00", a => "\x07", t => "\x09",
- n => "\x0a", v => "\x0b", f => "\x0c",
- r => "\x0d", e => "\x1b", '\\' => '\\',
+ z => "\x00", a => "\x07", t => "\x09",
+ n => "\x0a", v => "\x0b", f => "\x0c",
+ r => "\x0d", e => "\x1b", '\\' => '\\',
);
@@ -49,318 +49,318 @@ my %UNESCAPES = (
# Create an empty YAML::Tiny object
sub new {
- my $class = shift;
- bless [ @_ ], $class;
+ my $class = shift;
+ bless [ @_ ], $class;
}
# Create an object from a file
sub read {
- my $class = ref $_[0] ? ref shift : shift;
-
- # Check the file
- my $file = shift or return $class->_error( 'You did not specify a file name' );
- return $class->_error( "File '$file' does not exist" ) unless -e $file;
- return $class->_error( "'$file' is a directory, not a file" ) unless -f _;
- return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _;
-
- # Slurp in the file
- local $/ = undef;
- local *CFG;
- unless ( open(CFG, $file) ) {
- return $class->_error("Failed to open file '$file': $!");
- }
- my $contents = <CFG>;
- unless ( close(CFG) ) {
- return $class->_error("Failed to close file '$file': $!");
- }
-
- $class->read_string( $contents );
+ my $class = ref $_[0] ? ref shift : shift;
+
+ # Check the file
+ my $file = shift or return $class->_error( 'You did not specify a file name' );
+ return $class->_error( "File '$file' does not exist" ) unless -e $file;
+ return $class->_error( "'$file' is a directory, not a file" ) unless -f _;
+ return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _;
+
+ # Slurp in the file
+ local $/ = undef;
+ local *CFG;
+ unless ( open(CFG, $file) ) {
+ return $class->_error("Failed to open file '$file': $!");
+ }
+ my $contents = <CFG>;
+ unless ( close(CFG) ) {
+ return $class->_error("Failed to close file '$file': $!");
+ }
+
+ $class->read_string( $contents );
}
# Create an object from a string
sub read_string {
- my $class = ref $_[0] ? ref shift : shift;
- my $self = bless [], $class;
- my $string = $_[0];
- unless ( defined $string ) {
- return $self->_error("Did not provide a string to load");
- }
-
- # Byte order marks
- # NOTE: Keeping this here to educate maintainers
- # my %BOM = (
- # "\357\273\277" => 'UTF-8',
- # "\376\377" => 'UTF-16BE',
- # "\377\376" => 'UTF-16LE',
- # "\377\376\0\0" => 'UTF-32LE'
- # "\0\0\376\377" => 'UTF-32BE',
- # );
- if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
- return $self->_error("Stream has a non UTF-8 BOM");
- } else {
- # Strip UTF-8 bom if found, we'll just ignore it
- $string =~ s/^\357\273\277//;
- }
-
- # Try to decode as utf8
- utf8::decode($string) if HAVE_UTF8;
-
- # Check for some special cases
- return $self unless length $string;
- unless ( $string =~ /[\012\015]+\z/ ) {
- return $self->_error("Stream does not end with newline character");
- }
-
- # Split the file into lines
- my @lines = grep { ! /^\s*(?:\#.*)?\z/ }
- split /(?:\015{1,2}\012|\015|\012)/, $string;
-
- # Strip the initial YAML header
- @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/ and shift @lines;
-
- # A nibbling parser
- while ( @lines ) {
- # Do we have a document header?
- if ( $lines[0] =~ /^---\s*(?:(.+)\s*)?\z/ ) {
- # Handle scalar documents
- shift @lines;
- if ( defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/ ) {
- push @$self, $self->_read_scalar( "$1", [ undef ], \@lines );
- next;
- }
- }
-
- if ( ! @lines or $lines[0] =~ /^(?:---|\.\.\.)/ ) {
- # A naked document
- push @$self, undef;
- while ( @lines and $lines[0] !~ /^---/ ) {
- shift @lines;
- }
-
- } elsif ( $lines[0] =~ /^\s*\-/ ) {
- # An array at the root
- my $document = [ ];
- push @$self, $document;
- $self->_read_array( $document, [ 0 ], \@lines );
-
- } elsif ( $lines[0] =~ /^(\s*)\S/ ) {
- # A hash at the root
- my $document = { };
- push @$self, $document;
- $self->_read_hash( $document, [ length($1) ], \@lines );
-
- } else {
- croak("YAML::Tiny failed to classify the line '$lines[0]'");
- }
- }
-
- $self;
+ my $class = ref $_[0] ? ref shift : shift;
+ my $self = bless [], $class;
+ my $string = $_[0];
+ unless ( defined $string ) {
+ return $self->_error("Did not provide a string to load");
+ }
+
+ # Byte order marks
+ # NOTE: Keeping this here to educate maintainers
+ # my %BOM = (
+ # "\357\273\277" => 'UTF-8',
+ # "\376\377" => 'UTF-16BE',
+ # "\377\376" => 'UTF-16LE',
+ # "\377\376\0\0" => 'UTF-32LE'
+ # "\0\0\376\377" => 'UTF-32BE',
+ # );
+ if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
+ return $self->_error("Stream has a non UTF-8 BOM");
+ } else {
+ # Strip UTF-8 bom if found, we'll just ignore it
+ $string =~ s/^\357\273\277//;
+ }
+
+ # Try to decode as utf8
+ utf8::decode($string) if HAVE_UTF8;
+
+ # Check for some special cases
+ return $self unless length $string;
+ unless ( $string =~ /[\012\015]+\z/ ) {
+ return $self->_error("Stream does not end with newline character");
+ }
+
+ # Split the file into lines
+ my @lines = grep { ! /^\s*(?:\#.*)?\z/ }
+ split /(?:\015{1,2}\012|\015|\012)/, $string;
+
+ # Strip the initial YAML header
+ @lines and $lines[0] =~ /^\%YAML[: ][\d\.]+.*\z/ and shift @lines;
+
+ # A nibbling parser
+ while ( @lines ) {
+ # Do we have a document header?
+ if ( $lines[0] =~ /^---\s*(?:(.+)\s*)?\z/ ) {
+ # Handle scalar documents
+ shift @lines;
+ if ( defined $1 and $1 !~ /^(?:\#.+|\%YAML[: ][\d\.]+)\z/ ) {
+ push @$self, $self->_read_scalar( "$1", [ undef ], \@lines );
+ next;
+ }
+ }
+
+ if ( ! @lines or $lines[0] =~ /^(?:---|\.\.\.)/ ) {
+ # A naked document
+ push @$self, undef;
+ while ( @lines and $lines[0] !~ /^---/ ) {
+ shift @lines;
+ }
+
+ } elsif ( $lines[0] =~ /^\s*\-/ ) {
+ # An array at the root
+ my $document = [ ];
+ push @$self, $document;
+ $self->_read_array( $document, [ 0 ], \@lines );
+
+ } elsif ( $lines[0] =~ /^(\s*)\S/ ) {
+ # A hash at the root
+ my $document = { };
+ push @$self, $document;
+ $self->_read_hash( $document, [ length($1) ], \@lines );
+
+ } else {
+ croak("YAML::Tiny failed to classify the line '$lines[0]'");
+ }
+ }
+
+ $self;
}
# Deparse a scalar string to the actual scalar
sub _read_scalar {
- my ($self, $string, $indent, $lines) = @_;
-
- # Trim trailing whitespace
- $string =~ s/\s*\z//;
-
- # Explitic null/undef
- return undef if $string eq '~';
-
- # Quotes
- if ( $string =~ /^\'(.*?)\'\z/ ) {
- return '' unless defined $1;
- $string = $1;
- $string =~ s/\'\'/\'/g;
- return $string;
- }
- if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) {
- # Reusing the variable is a little ugly,
- # but avoids a new variable and a string copy.
- $string = $1;
- $string =~ s/\\"/"/g;
- $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex;
- return $string;
- }
-
- # Special cases
- if ( $string =~ /^[\'\"!&]/ ) {
- croak("YAML::Tiny does not support a feature in line '$lines->[0]'");
- }
- return {} if $string eq '{}';
- return [] if $string eq '[]';
-
- # Regular unquoted string
- return $string unless $string =~ /^[>|]/;
-
- # Error
- croak("YAML::Tiny failed to find multi-line scalar content") unless @$lines;
-
- # Check the indent depth
- $lines->[0] =~ /^(\s*)/;
- $indent->[-1] = length("$1");
- if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) {
- croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
- }
-
- # Pull the lines
- my @multiline = ();
- while ( @$lines ) {
- $lines->[0] =~ /^(\s*)/;
- last unless length($1) >= $indent->[-1];
- push @multiline, substr(shift(@$lines), length($1));
- }
-
- my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
- my $t = (substr($string, 1, 1) eq '-') ? '' : "\n";
- return join( $j, @multiline ) . $t;
+ my ($self, $string, $indent, $lines) = @_;
+
+ # Trim trailing whitespace
+ $string =~ s/\s*\z//;
+
+ # Explitic null/undef
+ return undef if $string eq '~';
+
+ # Quotes
+ if ( $string =~ /^\'(.*?)\'\z/ ) {
+ return '' unless defined $1;
+ $string = $1;
+ $string =~ s/\'\'/\'/g;
+ return $string;
+ }
+ if ( $string =~ /^\"((?:\\.|[^\"])*)\"\z/ ) {
+ # Reusing the variable is a little ugly,
+ # but avoids a new variable and a string copy.
+ $string = $1;
+ $string =~ s/\\"/"/g;
+ $string =~ s/\\([never\\fartz]|x([0-9a-fA-F]{2}))/(length($1)>1)?pack("H2",$2):$UNESCAPES{$1}/gex;
+ return $string;
+ }
+
+ # Special cases
+ if ( $string =~ /^[\'\"!&]/ ) {
+ croak("YAML::Tiny does not support a feature in line '$lines->[0]'");
+ }
+ return {} if $string eq '{}';
+ return [] if $string eq '[]';
+
+ # Regular unquoted string
+ return $string unless $string =~ /^[>|]/;
+
+ # Error
+ croak("YAML::Tiny failed to find multi-line scalar content") unless @$lines;
+
+ # Check the indent depth
+ $lines->[0] =~ /^(\s*)/;
+ $indent->[-1] = length("$1");
+ if ( defined $indent->[-2] and $indent->[-1] <= $indent->[-2] ) {
+ croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
+ }
+
+ # Pull the lines
+ my @multiline = ();
+ while ( @$lines ) {
+ $lines->[0] =~ /^(\s*)/;
+ last unless length($1) >= $indent->[-1];
+ push @multiline, substr(shift(@$lines), length($1));
+ }
+
+ my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
+ my $t = (substr($string, 1, 1) eq '-') ? '' : "\n";
+ return join( $j, @multiline ) . $t;
}
# Parse an array
sub _read_array {
- my ($self, $array, $indent, $lines) = @_;
-
- while ( @$lines ) {
- # Check for a new document
- if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) {
- while ( @$lines and $lines->[0] !~ /^---/ ) {
- shift @$lines;
- }
- return 1;
- }
-
- # Check the indent level
- $lines->[0] =~ /^(\s*)/;
- if ( length($1) < $indent->[-1] ) {
- return 1;
- } elsif ( length($1) > $indent->[-1] ) {
- croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
- }
-
- if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) {
- # Inline nested hash
- my $indent2 = length("$1");
- $lines->[0] =~ s/-/ /;
- push @$array, { };
- $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines );
-
- } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) {
- # Array entry with a value
- shift @$lines;
- push @$array, $self->_read_scalar( "$2", [ @$indent, undef ], $lines );
-
- } elsif ( $lines->[0] =~ /^\s*\-\s*\z/ ) {
- shift @$lines;
- unless ( @$lines ) {
- push @$array, undef;
- return 1;
- }
- if ( $lines->[0] =~ /^(\s*)\-/ ) {
- my $indent2 = length("$1");
- if ( $indent->[-1] == $indent2 ) {
- # Null array entry
- push @$array, undef;
- } else {
- # Naked indenter
- push @$array, [ ];
- $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines );
- }
-
- } elsif ( $lines->[0] =~ /^(\s*)\S/ ) {
- push @$array, { };
- $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines );
-
- } else {
- croak("YAML::Tiny failed to classify line '$lines->[0]'");
- }
-
- } elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) {
- # This is probably a structure like the following...
- # ---
- # foo:
- # - list
- # bar: value
- #
- # ... so lets return and let the hash parser handle it
- return 1;
-
- } else {
- croak("YAML::Tiny failed to classify line '$lines->[0]'");
- }
- }
-
- return 1;
+ my ($self, $array, $indent, $lines) = @_;
+
+ while ( @$lines ) {
+ # Check for a new document
+ if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) {
+ while ( @$lines and $lines->[0] !~ /^---/ ) {
+ shift @$lines;
+ }
+ return 1;
+ }
+
+ # Check the indent level
+ $lines->[0] =~ /^(\s*)/;
+ if ( length($1) < $indent->[-1] ) {
+ return 1;
+ } elsif ( length($1) > $indent->[-1] ) {
+ croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
+ }
+
+ if ( $lines->[0] =~ /^(\s*\-\s+)[^\'\"]\S*\s*:(?:\s+|$)/ ) {
+ # Inline nested hash
+ my $indent2 = length("$1");
+ $lines->[0] =~ s/-/ /;
+ push @$array, { };
+ $self->_read_hash( $array->[-1], [ @$indent, $indent2 ], $lines );
+
+ } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) {
+ # Array entry with a value
+ shift @$lines;
+ push @$array, $self->_read_scalar( "$2", [ @$indent, undef ], $lines );
+
+ } elsif ( $lines->[0] =~ /^\s*\-\s*\z/ ) {
+ shift @$lines;
+ unless ( @$lines ) {
+ push @$array, undef;
+ return 1;
+ }
+ if ( $lines->[0] =~ /^(\s*)\-/ ) {
+ my $indent2 = length("$1");
+ if ( $indent->[-1] == $indent2 ) {
+ # Null array entry
+ push @$array, undef;
+ } else {
+ # Naked indenter
+ push @$array, [ ];
+ $self->_read_array( $array->[-1], [ @$indent, $indent2 ], $lines );
+ }
+
+ } elsif ( $lines->[0] =~ /^(\s*)\S/ ) {
+ push @$array, { };
+ $self->_read_hash( $array->[-1], [ @$indent, length("$1") ], $lines );
+
+ } else {
+ croak("YAML::Tiny failed to classify line '$lines->[0]'");
+ }
+
+ } elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) {
+ # This is probably a structure like the following...
+ # ---
+ # foo:
+ # - list
+ # bar: value
+ #
+ # ... so lets return and let the hash parser handle it
+ return 1;
+
+ } else {
+ croak("YAML::Tiny failed to classify line '$lines->[0]'");
+ }
+ }
+
+ return 1;
}
# Parse an array
sub _read_hash {
- my ($self, $hash, $indent, $lines) = @_;
-
- while ( @$lines ) {
- # Check for a new document
- if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) {
- while ( @$lines and $lines->[0] !~ /^---/ ) {
- shift @$lines;
- }
- return 1;
- }
-
- # Check the indent level
- $lines->[0] =~ /^(\s*)/;
- if ( length($1) < $indent->[-1] ) {
- return 1;
- } elsif ( length($1) > $indent->[-1] ) {
- croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
- }
-
- # Get the key
- unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) {
- if ( $lines->[0] =~ /^\s*[?\'\"]/ ) {
- croak("YAML::Tiny does not support a feature in line '$lines->[0]'");
- }
- croak("YAML::Tiny failed to classify line '$lines->[0]'");
- }
- my $key = $1;
-
- # Do we have a value?
- if ( length $lines->[0] ) {
- # Yes
- $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines );
- } else {
- # An indent
- shift @$lines;
- unless ( @$lines ) {
- $hash->{$key} = undef;
- return 1;
- }
- if ( $lines->[0] =~ /^(\s*)-/ ) {
- $hash->{$key} = [];
- $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines );
- } elsif ( $lines->[0] =~ /^(\s*)./ ) {
- my $indent2 = length("$1");
- if ( $indent->[-1] >= $indent2 ) {
- # Null hash entry
- $hash->{$key} = undef;
- } else {
- $hash->{$key} = {};
- $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines );
- }
- }
- }
- }
-
- return 1;
+ my ($self, $hash, $indent, $lines) = @_;
+
+ while ( @$lines ) {
+ # Check for a new document
+ if ( $lines->[0] =~ /^(?:---|\.\.\.)/ ) {
+ while ( @$lines and $lines->[0] !~ /^---/ ) {
+ shift @$lines;
+ }
+ return 1;
+ }
+
+ # Check the indent level
+ $lines->[0] =~ /^(\s*)/;
+ if ( length($1) < $indent->[-1] ) {
+ return 1;
+ } elsif ( length($1) > $indent->[-1] ) {
+ croak("YAML::Tiny found bad indenting in line '$lines->[0]'");
+ }
+
+ # Get the key
+ unless ( $lines->[0] =~ s/^\s*([^\'\" ][^\n]*?)\s*:(\s+|$)// ) {
+ if ( $lines->[0] =~ /^\s*[?\'\"]/ ) {
+ croak("YAML::Tiny does not support a feature in line '$lines->[0]'");
+ }
+ croak("YAML::Tiny failed to classify line '$lines->[0]'");
+ }
+ my $key = $1;
+
+ # Do we have a value?
+ if ( length $lines->[0] ) {
+ # Yes
+ $hash->{$key} = $self->_read_scalar( shift(@$lines), [ @$indent, undef ], $lines );
+ } else {
+ # An indent
+ shift @$lines;
+ unless ( @$lines ) {
+ $hash->{$key} = undef;
+ return 1;
+ }
+ if ( $lines->[0] =~ /^(\s*)-/ ) {
+ $hash->{$key} = [];
+ $self->_read_array( $hash->{$key}, [ @$indent, length($1) ], $lines );
+ } elsif ( $lines->[0] =~ /^(\s*)./ ) {
+ my $indent2 = length("$1");
+ if ( $indent->[-1] >= $indent2 ) {
+ # Null hash entry
+ $hash->{$key} = undef;
+ } else {
+ $hash->{$key} = {};
+ $self->_read_hash( $hash->{$key}, [ @$indent, length($1) ], $lines );
+ }
+ }
+ }
+ }
+
+ return 1;
}
# Set error
sub _error {
- $YAML::Tiny::errstr = $_[1];
- undef;
+ $YAML::Tiny::errstr = $_[1];
+ undef;
}
# Retrieve error
sub errstr {
- $YAML::Tiny::errstr;
+ $YAML::Tiny::errstr;
}
@@ -369,28 +369,28 @@ sub errstr {
# Use Scalar::Util if possible, otherwise emulate it
BEGIN {
- eval {
- require Scalar::Util;
- };
- if ( $@ ) {
- # Failed to load Scalar::Util
- eval <<'END_PERL';
+ eval {
+ require Scalar::Util;
+ };
+ if ( $@ ) {
+ # Failed to load Scalar::Util
+ eval <<'END_PERL';
sub refaddr {
- my $pkg = ref($_[0]) or return undef;
- if (!!UNIVERSAL::can($_[0], 'can')) {
- bless $_[0], 'Scalar::Util::Fake';
- } else {
- $pkg = undef;
- }
- "$_[0]" =~ /0x(\w+)/;
- my $i = do { local $^W; hex $1 };
- bless $_[0], $pkg if defined $pkg;
- $i;
+ my $pkg = ref($_[0]) or return undef;
+ if (!!UNIVERSAL::can($_[0], 'can')) {
+ bless $_[0], 'Scalar::Util::Fake';
+ } else {
+ $pkg = undef;
+ }
+ "$_[0]" =~ /0x(\w+)/;
+ my $i = do { local $^W; hex $1 };
+ bless $_[0], $pkg if defined $pkg;
+ $i;
}
END_PERL
- } else {
- Scalar::Util->import('refaddr');
- }
+ } else {
+ Scalar::Util->import('refaddr');
+ }
}
@@ -47,6 +47,8 @@ my $zilla2 = Dist::Zilla::Tester->from_config({
chdir $zilla2->tempdir->subdir('source');
system "git init -q";
my $git2 = Git::Wrapper->new('.');
+$git2->config( 'user.name' => 'dzp-git test' );
+$git2->config( 'user.email' => 'dzp-git@test' );
$git2->remote('add','origin', $zilla->tempdir->subdir('source'));
$git2->fetch;
$git2->reset('--hard','origin/master');
@@ -66,6 +68,8 @@ my $zilla3 = Dist::Zilla::Tester->from_config({
chdir $zilla3->tempdir->subdir('source');
system "git init -q";
my $git3 = Git::Wrapper->new('.');
+$git3->config( 'user.name' => 'dzp-git test' );
+$git3->config( 'user.email' => 'dzp-git@test' );
$git3->remote('add','origin', $zilla->tempdir->subdir('source'));
$git3->fetch;
$git3->branch('build/master', 'origin/build/master');
@@ -17,7 +17,8 @@ use Cwd qw{ getcwd };
use File::Temp qw{ tempdir };
use Git::Wrapper;
use Path::Class;
-use Test::More tests => 6;
+use Test::More;
+use version;
# build fake repository
my $zilla = Dist::Zilla::Tester->from_config({
@@ -28,6 +29,15 @@ chdir $zilla->tempdir->subdir('source');
system "git init";
my $git = Git::Wrapper->new('.');
+# rt#56485 - skip test to avoid failures for old git versions
+my ($version) = $git->version =~ m[^( \d+ \. \d+ \. \d+ )]x;
+my $gitversion = version->parse( $version );
+if ( $gitversion < version->parse('1.7.0') ) {
+ plan skip_all => 'git 1.7.0 or later required for this test';
+} else {
+ plan tests => 6;
+}
+
$git->config( 'user.name' => 'dzp-git test' );
$git->config( 'user.email' => 'dzp-git@test' );
$git->add( qw{ dist.ini Changes } );
@@ -17,7 +17,8 @@ use Cwd qw{ getcwd };
use File::Temp qw{ tempdir };
use Git::Wrapper;
use Path::Class;
-use Test::More tests => 3;
+use Test::More;
+use version;
# build fake repository
my $zilla = Dist::Zilla::Tester->from_config({
@@ -26,7 +27,16 @@ my $zilla = Dist::Zilla::Tester->from_config({
chdir $zilla->tempdir->subdir('source');
system "git init";
-my $git = Git::Wrapper->new('.');
+my $git = Git::Wrapper->new('.');
+
+# rt#56485 - skip test to avoid failures for old git versions
+my ($version) = $git->version =~ m[^( \d+ \. \d+ \. \d+ )]x;
+my $gitversion = version->parse( $version );
+if ( $gitversion < version->parse('1.7.0') ) {
+ plan skip_all => 'git 1.7.0 or later required for this test';
+} else {
+ plan tests => 3;
+}
$git->config( 'user.name' => 'dzp-git test' );
$git->config( 'user.email' => 'dzp-git@test' );